import request, {qss} from "../../util/request";
import qs from 'qs'

/**
 * 下载会话
 * @returns {*}
 */
export const downLoadSession = () => {
    let url = 'api/msg/center/session'
    return request.get(url)
}

/**
 * 分页下载聊天记录
 * @param sessionId
 * @param page
 * @param limit
 * @returns {*}
 */
export const downloadMsgList = (sessionId, chatType, firstMsgTime, limit) => {
    let url = 'api/msg/center/msg'

    return request.get(url, {
        params: {
            sessionId: sessionId,
            chatType: chatType,
            firstMsgTime: firstMsgTime,
            limit: limit
        }
    })
}

export const downloadUserInfo = (userIds) => {
    let url = 'api/msg/center/userInfo'
    console.log(userIds)
    let param = {
        userIds: userIds
    }
    return request.post(url,qs.stringify(param,{ indices: false }))
}


export const downloadGroupInfo = (groupIds) => {
    let url = 'api/msg/center/groupInfo'
    let param = {
        groupIds: groupIds
    }
    return request.post(url,qs.stringify(param,{ indices: false }))
}




